const jwt = require('koa-jwt');
const Router = require('koa-router');
const router = new Router({prefix:'/admins'});
const { create,delete:del,updatePassword,login} = require('../controllers/admins');
const {secret} = require('../config/index');
const auth = jwt({ secret });


router.post('/',create);
router.delete('/:id',auth,del);

//登录
router.post('/login',login);

router.patch(`/updatePassword`,auth,updatePassword)
module.exports = router;